// 平台属性管理模块请求文件
import request from '@/utils/request'

// GET /admin/product/getCategory1
// 获取一级分类

// GET /admin/product/getCategory2/{category1Id}
// getCategory2

// GET /admin/product/getCategory3/{category2Id}
// getCategory3
// 一级分类
export const reqCategoryList1 = () => request({
  url: '/admin/product/getCategory1',
  method: 'get'
})
// 二级分类
export const reqCategoryList2 = (category1Id) => request({
  url: `/admin/product/getCategory2/${category1Id}`,
  method: 'get'
})
// 三级分类
export const reqCategoryList3 = (category2Id) => request({
  url: `/admin/product/getCategory3/${category2Id}`,
  method: 'get'
})

// 获取平台属性
// GET /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
// attrInfoList
export const reqAttrList = (category1Id, category2Id, category3Id) => request({
  url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
  method: 'get'
})

// 添加或者更新属性与属性值
// POST /admin/product/saveAttrInfo
// saveAttrInfo
export const reqAddOrUpdateAttr = (data) => request({
  url: `/admin/product/saveAttrInfo`,
  method: 'post',
  data
})
